const items=[1,3,4,2,6,3,4,6,8,4,'fg',true,'hg,r',7]
const sequence={
    [Symbol.iterator](){
        let i=0
        return{
            next(){
                const value=items[i]
                i++
                console.log("index:"+i+" value:"+items[i]+"\n");
                const done=i>items.length-1
                return{value,done}
            }
        }
    }
}

for(const item of sequence){
    console.log(item);
}